package com.example.book.enums;

public enum BookStatusEnum {
    DELETED(0,"删除"),
    NORMAL(1,"可借阅"),
    FORBIDDEN(2,"不可借阅");

    public static BookStatusEnum getNameByCode(Integer code) {
        switch (code) {
            case 0: return BookStatusEnum.DELETED;
            case  1: return BookStatusEnum.NORMAL;
            default:
                return FORBIDDEN;
        }
    }
    private Integer code;
    private String naem;

    BookStatusEnum(Integer code, String naem) {
        this.code = code;
        this.naem = naem;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getNaem() {
        return naem;
    }

    public void setNaem(String naem) {
        this.naem = naem;
    }
}
